{% macro file_information_span(file_object, root_uid, selected_analysis=None, filename_only=False) %}
    {% set selected_analysis_url = selected_analysis + '/' if selected_analysis else '' %}
    <a href="/analysis/{{ file_object.uid }}/{{ selected_analysis_url }}ro/{{ root_uid }}">
        {% if filename_only %}
            <h6>{{ file_object.file_name | safe }}</h6>
        {% else %}
            <h6>{{ file_object.current_virtual_path[0] | safe }}</h6>
        {% endif %}
    </a>
    <p class="d-flex justify-content-between mb-0">
        <span>Size: {{ file_object.size | number_format }}
            {% if file_object['mime-type'] %}
                , Type: {{ file_object['mime-type'] }}
            {% endif %}
        </span>
        <a href="/download/{{ file_object.uid }}"><i class="fas fa-download"></i></a>
    </p>
{% endmacro %}

{% macro collapse_head(collapse_id, list_length) %}
    <div class="list-group-item list-group-item-primary d-flex justify-content-between align-items-center" data-toggle="collapse" data-target="#{{ collapse_id }}" role="button">
        show file
        <span class="badge badge-primary badge-pill">{{ list_length }}</span>
    </div>
{% endmacro %}
